package com.jiyun.service.impl;

import com.jiyun.pojo.News;
import com.jiyun.mapper.NewsMapper;
import com.jiyun.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class NewsServiceImpl implements NewsService {

    @Autowired
    private NewsMapper newsMapper;

    @Override
    public List<News> getAll() {
        List<News> news = newsMapper.selectList(null);
        return news;
    }

    @Override
    public News getNewsById(Integer id) {
        News news = newsMapper.selectById(id);
        return news;
    }
}
